<?php
/**
 * Created by PhpStorm.
 * User: Thans
 * Date: 2018/1/3
 * Time: 下午3:59
 */
namespace app\open\controller;
use think\captcha\Captcha;
use think\facade\Request;

class CaptchaController
{
    public function verify()
    {
        $type = Request::param('type')?Request::param('type'):'';
        $config =    [
            // 验证码字体大小
            'fontSize'    =>  Request::param('size')?Request::param('size'):'30',
            // 验证码位数
            'length'     =>    4,
            'imageH'    =>     Request::param('height')?:'0',
            'imageW'    =>     Request::param('width')?:'0',
        ];
        $captcha = new Captcha($config);
        $captcha->codeSet = '2345679ABCDEFGHJKMNPQRSTUVWXYZ';
        return $captcha->entry($type);
    }
}